﻿@page "/Admin/FileManager"

@using BlazorAdmin.Models
@using Pangeo.Admin.Models


<Split Basis="320">
    <FirstPaneTemplate>
        <Card>
            <BodyTemplate>
                <TreeView TItem="Organize" ShowIcon=true ShowSkeleton=true Items=OrganizeTree OnTreeItemClick=OnOrganizeClick />
            </BodyTemplate>
        </Card>
    </FirstPaneTemplate>
    <SecondPaneTemplate>
        <Card>
            <HeaderTemplate>
                <div class="btn-group" role="group">
                    <Button Color="Color.Primary" OnClick=CreateDirectory Text="创建目录" />
                    <ButtonUpload BrowserButtonText="上传" BrowserButtonClass="btn-success" class="no-radius" TValue="string" IsMultiple=true OnChange=UploadFile ShowUploadFileList=false />
                    <Button Color="Color.Info" IsAsync=true Icon="fa-solid fa-download" OnClick=DownloadFile Text="下载" />
                    <PopConfirmButton Placement="Placement.Top" Color="Color.Danger" Icon="fa-regular fa-trash-can" ConfirmIcon="fa-solid fa-exclamation-circle text-danger" 
                        ConfirmButtonColor="Color.Danger" Text="删除" Content="确定要删除当前目录吗？" OnConfirm="DeleteFile" />
                    <Button Color="Color.Secondary" Icon="fas fa-repeat" OnClick=RefreshDirTree Text="刷新" />
                </div>
            </HeaderTemplate>
            <BodyTemplate>
                <TreeView @ref=FileTree IsAccordion=true ShowIcon=true ShowSkeleton=true Items=FileDirTree OnTreeItemClick=OnTreeItemChecked />
            </BodyTemplate>
        </Card>
    </SecondPaneTemplate>
</Split>